home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 1992 August / info-mac-1992.iso / Language (lang) / Lazy-Scheme / Docs / Doc-English.Ascii next >
Text File  |  1992-06-29  |  79KB  |  1,976 lines

  1.  
  2.  
  3. Conclusion
  4.  
  5. Bibliographie
  6.  
  7. Bibliographie
  8.  
  9. Exemples
  10.  
  11. Index
  12.  
  13. Exemples
  14.  
  15. Index
  16.  
  17. Index
  18.  
  19. Index
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. Help
  27.  
  28.  
  29. Version 1.0 (January 91)
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. A Scheme-like Lazy Lisp dialect 
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. This is Freeware
  51. Copyright Thomas SCHIEX  1991
  52. e-mail: schiex@cert.fr, schiex@irit.fr
  53.  
  54.  
  55.  
  56.  
  57. Table of Contents
  58.  
  59.  
  60. Table of Contents    1
  61. 5 The manual    3
  62. 5.1 An overview    4
  63. 5.1.1 Semantics    4
  64. 5.1.2 Syntax    4
  65. 5.1.3 Notation and terminology    4
  66. 5.2 Readable and non readable objects    5
  67. 5.2.1 The numbers (fixnums, bignums and floatings)    6
  68. 5.2.2 The lists    7
  69. 5.2.3 The cells    7
  70. 5.2.4 Bit-arrays    8
  71. 5.2.5 The strings    8
  72. 5.2.6 Symbols    8
  73. 5.2.7 Unreadable objects    9
  74. 5.2.8 Special characters and delimiters    10
  75. 5.3 The primitive expressions    10
  76. 5.3.1 Litteral references  (constants, “quoted” symbols …)    10
  77. 5.3.2 Variables references    11
  78. 5.3.3 Closure application    11
  79. 5.3.4 Closure creation    11
  80. 5.3.5 Conditional    12
  81. 5.3.6 Assignment    12
  82. 5.3.7 Non-memoïzing suspension    12
  83. 5.3.9 Environment    13
  84. 5.3.10 Defining macros    13
  85. 5.3.10 Defining external functions    13
  86. 5.3.11 Creating bindings    14
  87. 5.3.12 Sequence    14
  88. 5.3.12 Debugging    14
  89. 5.4 Predefined closures    16
  90. 5.4.1 Booleans    16
  91. 5.4.2 Equivalence predicates    16
  92. 5.4.3 Lists and conses    17
  93. 5.4.4 Symbols    19
  94. 5.4.5 Numbers    20
  95. 5.4.6 Closures    22
  96. 5.4.7 Macros    23
  97. 5.4.8 Cells (or vectors)    23
  98. 5.4.9 Environments    24
  99. 5.4.10 Bit-arrays    25
  100. 5.4.11 Entrées-Sorties    27
  101. 5.4.12 Erreurs et gestion d’errors    28
  102. 5.4.13 Control    29
  103. 5.4.14 System    30
  104. 5.5 Help interface    32
  105. 5.5.1 Configuration    33
  106. 5.5.2 Using the editor    34
  107. 5.5.2 The valuator and the “bugs”…    35
  108. Bibliography    37
  109. Examples    41
  110. Index    45
  111.  
  112.  
  113. Free use and non-commercial reproduction of the binaries of the interpreter is permitted, providing that the copyright notices are not removed and left unmodified.  Distribution by disk is permitted provided only a nominal copying fee is charged. Upload to commercial bulletin boards is also permitted, providing charges are only made for connect time, and there is no specific charge made for the file.
  114.  
  115. This software is actually freeware, but any donation (under any useful form), e-mail, s-mail or encouragement, is greatly appreciated by the author. I do not want to work (during week-ends) on something that is left unused except by four or five people. Thanks !
  116.  
  117. For queries and bug reports write or e-mail to the author:
  118.  
  119. Thomas SCHIEX
  120. Centre d’Etudes et de Recherche de Toulouse (ONERA)
  121. 2, Av Edouard Belin
  122. BP 4025
  123. 31055 TOULOUSE CEDEX
  124. FRANCE
  125. e-mail: schiex@cert.fr
  126.  
  127. No responsibilities accepted for bugs, but please let me know so I may try to fix them.
  128.  
  129. For your information, Help is mainly written in 680x0 assembly language. Porting it to C, or any “portable” language is not even considered (at this time).  
  130.  
  131. The archive file is organized as follows:
  132.  
  133. Paresseux: The  HELP interpreter. The needed memory may be changed via the Finder “Get Info”.
  134. Docs: as the name says…
  135. Examples: as the name says… One may find various theorical examples from lambda-calculus, a constraint solver (“test and generate”, no forward checking or arc-consistency)…
  136. Divers: (miscellaneous) contains 1) resedit templates ressouces to insert in your Resedit program to ease Help ressources editing, 2) the symbolic code generated by the Help compiler for fibonacci (fib), 3) its conversion in real assembly lang. (foreign.a), 4) the language machine code (Foreign) and 5) a file that load and links everything (Fib-init). 6) A simple stepper for Help is in the “Stepper” file (load it from help and use step syntactic form).
  137. Compilo: a compiler kernel for Help (compiles to 680x0 code, symbolic syntax). Probably not understandable by the vulgum pecus, but given as an example…
  138. Readme: a simple readme file (TEXT)
  139. start: a file needed by Help, loaded upon booting. Must stay in the Help folder.
  140.  
  141.     Have fun !
  142. 5 The manual
  143. 
  144. Let us recall first that Help is, before anything else, a Lisp interpreter. Anybody having a good knowledge of Lisp, or even better Scheme ,may in a first step, immediately try the binaries, but beware of lazyness ! If you want to use Help and change its configuration, consider reading  §5.5FR.
  145.  
  146. 5.1 An overview
  147.  
  148. 5.1.1 .i.Semantics
  149.  
  150.  
  151. t  Help is a statically1  scoped language (identifier scope is lexical) as are Scheme, Algol… Each identifier occurrence is associated with a lexically visible binding of this identifier.
  152.  
  153. t  Help is non-sctrict, relying on call by need (also referred as “lazyness”) for every parameter passing as in Lazy Miranda, Hope…
  154.  
  155. t  Help is dynamically typed (types are latent), i.e. types are associated with values not variables. This is usual in Lisp, APL, Snobol…
  156.  
  157. t  Help closures (or procedures) are full citizens that may be dynamically created, gathered in any data structure (eventually infinite data structures)… Help shares this quality with every “functionnal” language (such as Hope, Miranda, Daisy…).
  158.  
  159. t  Help objects (closures, evironments, numbers) have unlimited extent. The memory management software will simply collect any object that may not be referenced by Help user (usually referred as the “GC” or “Garbage Collector”). The same type of system is used in every Lisp, APL, Prolog . It has been proposed for Ada, but no implementation i know has included it.
  160.  
  161. t  Help does not supports iteration, only recursion (lazyness and iteration do not originate from the same world). Therefore, the interpreter efficiently handles terminal recursions. This allows these recursions to operate with a fixed stack size consumption.
  162.  
  163. 5.1.2 Syntax
  164.  
  165. t    Help uses parenthesized for describing code and data. This syntax, whose simplicity is one of the main advantage is used (with some exceptions) by every Lisp dialect2.
  166.  
  167. 5.1.3 Notation and terminology
  168.  
  169. When Help semantics is yet undefined, we will consider that the value returned is an “undefined” value. In this case,  you should not rely on the peculiar value any implementation may return. You should notre that an unspecified value is different for the “unspecified error” which is a precisely specified value denoted by the symbol “?”.
  170.  
  171. In the following, the examples will always be presented in following typewriter style: exemples. The symbol “fl” used in these examples should be read as “whose value is printed as…”. Because of Help lazyness, there is an big difference between the internal representation (holding “suspended values”) and the external representation. This distinction is important. Infinite objects are usually limited by the interpreter’s printer. Dots (…) are used to denote the fact that the data structure is not completly printed. Example:
  172.  
  173. (letrec [(x (cons 1 x))] x) fl (1 1 1 1 1 1 1 …)
  174.  
  175. The § 5.3 and 5.4FR are composed of a sequence of definition. Each definition presents a closure or a syntactic form of the language and begins by a header specifying a model (how is the closure/syntactic form used), its type (the closures are separated in 2 types: ProcN whose arity is ficed, and NProc whose arity is not fixed), its arity (minimal arity for NProc), its arguments types (arguments  style). If there is no restriction on the arguments type, the word any  shall be used. The following types will be considered:
  176.  
  177. number      fixsize integer, “bignum” or floating point
  178. integer      fixsize integer, “bignum” 
  179. fix      fixsize integer 
  180. posfix      positive fixsize integer 
  181. bignum      “bignum” 
  182. floating      floating point
  183. smallnum      a number that is not a bignum
  184. list      conses or () (the empty list)
  185. cons      conses
  186. vector      vectors, also called “cells”
  187. environ     environment
  188. applicable     closure or fixpos
  189. symbol      symbol, error, constant,keyword…
  190. ident     variable or constant identifier 
  191. identv     variable identifier 
  192. keyword      syntactic keyword
  193. error      error
  194. bit-array      bit-array
  195. io-unit     input/output unit
  196. any      anything you may want
  197.  
  198. Example:
  199.  
  200. (cell=? vector posfix)    Closure:ProcN    2
  201.  
  202. says that  cell=? is a fixed arity closure (arity is equal to 2), whose arguments are a vector and a  number which should be a fixsize positive integer.
  203.  
  204. 5.2 Readable and non readable objects
  205.  
  206. At any time, a great deal of different objects exist in the memory (the heap). Most of these objects, whose external rpresentation is of matter to the user, are also readable (i.e., it is possible to give a syntactic description of the object that may be given to the Help “reader”. This reader will then create an internal representation of it). For pragmatic or feasability reasons, some objects have no external representations or eventually, have an external representation which is not readable.
  207.  
  208. The reader makes no distinction between upper or lower cases (except inside strings and for symbols interned with the“backslash” macro-char). So, the strings Foo, fOO denote a single  symbol. The space character (ASCII 32) eand carriage return(ASCII 13) are delimiters.
  209.  
  210. In the following, we will distinguish characters sequences (characters separated by delimiters (Cf § 5.2.7FR)) and strings (an object type in Help).
  211.  
  212. 5.2.1 The numbers (fixnums, bignums and floatings)
  213.  
  214. Rationnals and complexs are not yet available in Help. Moreover, there are strong restrictions on bignums use. 
  215.  
  216. 5.2.1.1 The .i.integers
  217.  
  218. An integer is always read in the current base. This base is fixed with the  closure ibase described later. The character sequences that are interpreted as numbers depend on this base. If the base is lower or equal to 10 (in decimal), the character between “0” and the base less one will be considered as digits. If the base is greater than 10 (It is limited to 36 internally), digits are extended using “a”…”z”. So, in hexa, The sequence “ff” represents an integer (not a symbol) whose value is 255 (decimal).
  219.  
  220. Let CarNum, be the set of characters representing digits.
  221.  
  222. number::=      number_unsigned    | 
  223.     +number_unsigned    | 
  224.     -number_unsigned
  225. number_unsigned::=     CarNum*
  226.  
  227. Examples:     123 +123 -123 +235987459862345  (base 10 at least)
  228.         12af  (base 16)  -foobar (base 29)
  229.  
  230. 5.2.1.1.1 Fixsize integers
  231.  
  232. When there is an internal representation as a “fixsize integer”, the reader will automatically use it. The value of a fixsize integer is between -2 147 483 648 and 2 147 483 647.
  233.  
  234. 5.2.1.1.2 Bignums
  235.  
  236. Every  integer that may not be internally represented as a fixsize integer will be read as a “bignum”. Pay attention that  “bignums” handling uses much stack space.
  237.  
  238. Allocation of temporary “bignums” on the stack during bignum computation implies that bignum size is limited:     
  239.                 1- by the heap size;
  240.                 2- by the stack size !
  241.  
  242. So, it is possible to get a “full stacks” error using a terminal recursion for Fibonacci if you use bignums (try (fib 50000)) …(NB: there is currently a bug in bignums multiplication)..
  243.  
  244. 5.2.1.2 .i.floatings
  245.  
  246. Every character sequence (that is not inside a string or a symbol interned via the “backslash” macro-char) holding a “.” will be considered as expressing a floating point. 
  247.  
  248. Motorola IEEE “extended-precision floating point” standard is actually used. It allows to express numbers between 1.9*10-4951 and 1.1*104932 . There are between 19 and 20 significative digits. It is also possible to denote forbidden operations (divide by zero…) generating “NaNs3” or infinity. These NaNs are not readable but are printable and used by Help (in fact your 68882).
  249.  
  250. The reading may be done using scientific notation (character “e” or “f” between mantissa and exponent) or classic (mantissa only). The floating is always read in decimal. The mantissa, as the exponent may follow a “+” or a “-”. 
  251.  
  252. Examples:     1.123456789123456789
  253.         1.1234f-2001
  254.         -233.2e+63
  255.  
  256. 5.2.2 The .i.lists ;(conses)
  257.  
  258. List expression relies on parenthesis and “conses”4 (as in Lisp):
  259.  
  260. t    The characters “(“, “)” et “|” sare for list expression and are delimiters;
  261. t    The empyu list will be denoted by a special symbol denoted by “()”;
  262. t    A cons  x(car | cdr) is represented by:   ( <car> | <cdr> ) where <car> is the representation of  “car”…;
  263. t    There is a simplified notation (when the cdr is a cons or the empty list): the pairs “| (“ and  the corresponding “)” may be omitted . So, one may write: (1 | ()) or (1).
  264.  
  265. Examples:      (1 | 2)
  266.         (1 2 3 4)
  267.         (1 | (2 | ()))
  268.         (1 (2 3 4) (5 (6)) 1)
  269.  
  270. 5.2.3 The .i.cells; (vectors)
  271.  
  272. A vector (or cell) will be represented using special delimiters “[“ and “]”.  A three elements cell e1, e2, e3 will be represented by [<e1> <e2> <e3>]
  273.  
  274. Examples:    []
  275.         [1 2 3]
  276.         [[1 2][2 3]]
  277.  
  278. 5.2.4 Bit-arrays
  279.  
  280. The delimiter “%” is used to express bit-arrays (.i.bit-arrays;). The sequence that follows should be composed of “0” or “1”.
  281.  
  282. Examples:    %
  283.         %11011000110110001101100011011000
  284.  
  285. 5.2.5 The .i.strings ;
  286.  
  287. The character “““ is used to express strings. Every character following a “““ upto the next  “““ swill be included in the string (including control chars, such as carriage return, linefeed…)
  288.  
  289. 5.2.6 .i.Symbols; (symbols, constants, errors…)
  290.  
  291. Every sequnce that is not in one of the previously defined syntactic domain and that does not hols a  “:” will express a simple symbol.
  292.  
  293. It is possible to force the reader to read a symbol for any sequence of character using the macro-character  “\”. So, reading the sequence“\12\” will create  an interned symbol whose name will be “12”.
  294.  
  295. Moreover, symbols are organized along a tree (as the packages tree in Le_Lisp) for the user use. A simple symbol will have  “()” as a father. It is possible to denote a son of a symbol (simple or not) by inserting a “:” and the son’s name. So:
  296.  
  297.     a      symbol “a”, father “()”
  298.     a:b      symbol “b” , father “a”, , father “()”
  299.     a:b:c:d:e    symbol “e” , father  “d”… 
  300.  
  301. Symbols ahave many different uses in Help:
  302.  
  303. t    symbols     ‘a
  304. t    variable     a
  305. t    keywords     (lambda (x) (1+ x))
  306. t    macro-expressions     (defmacro useless (lambda (t) ‘()))
  307. t    errors     ?:var-undef
  308. t    constants     (1+ 1)
  309.  
  310. IThere is no specific micro-syntax for each of these. The user may usually give the type of a symbol using specific closures or syntactic forms. 
  311.  
  312. Upon startup, several symbols are already defined.
  313.  
  314. 5.2.6.1 Keywords:
  315.  
  316. The following symbols are reserved .i.keywords;:
  317.  
  318. lambda cond define =! begin step nomemo
  319. defmacro quote let letrec bindings warn
  320.  
  321. 5.2.6.2 Errors:
  322.  
  323. The following table give the list of predefined .i.errors; . Usually, (this is not compulsory) an error is a son of the symbol” ?”.
  324.     
  325. Symbole    Definition
  326. ?    Undefined error
  327. ?:too-args    Too many arguments
  328. ?:few-args    Too few arguments
  329. ?:bad-type    Badly types arguments
  330. ?:bad-expr    Bad expression
  331. ?:syn-keyw    Keyword use forbidden here
  332. ?:syntx-er    General syntax error
  333. ?:mem-full    The heap is full
  334. ?:no-apply    The object us not applicable 
  335. ?:indx-out    Index out of bounds
  336. ?:strange!    A strange error has occurred
  337. ?:overflow    Overflow
  338. ?:cb-break    Break 
  339. ?:lispstck    The Lisp stack has been destroyed
  340. ?:contstck    The control stack has been destroyed
  341. ?:varundef    Undefined variable
  342. ?:stckfull    Piles pleines (collision)
  343. ?:maxlengt    Max length reached
  344. ?:io-error    I/O error
  345. ?:eof-error    End of file error
  346. ?:dead-cont    Chronologic continuation is dead
  347.  
  348. 5.2.6.3 Constants:
  349.  
  350. Many .i.constants; are predefineds. Most of them denote closures and will be described in §5.4.FR 
  351.  
  352. The symbol “()” is a constant whose value is itself that denotes the empty list;
  353. Thesymbol “†” is a constant whose value is itself that denotes the boolean TRUE;
  354. Thesymbol “ƒ” is a constant whose value is itself that denotes the boolean FALSE;
  355.  
  356. Pay attention that the symbol “()” is considered as TRUE in HELP. Only the boolean “ƒ” denotes FALSE.
  357.  
  358. 5.2.7 Unreadable objects
  359.  
  360. Among all the objects existing in memory, some are “unreadable”. These are the:
  361.  
  362. t    Environments (printable);
  363. t    Closures (printable);
  364. t    Code (partially);
  365. t    I/O Units (unprintable);
  366. t    Suspended forms (unprintable);
  367.  
  368.  
  369. 5.2.8 Special characters and delimiters
  370.  
  371. The following table gives the .i.special characters; list, whether they are delimiters, ad their corresponding  (if they exits) delimiters and role. When a number is given, It is the ascii code of the character. These characters are modifiable by the user (Cf §4.2.6FR).
  372.  
  373. C    Délim    Corresp    Role
  374. (    Yes    ) |    list, cons
  375. )    Yes    ( |    list, cons
  376. |    Yes    ( )    delimier between  CAR and CDR in a cons
  377. [    Yes    ]    start of  vector
  378. ]    Yes    [    end of  vector
  379. %    Yes    delim.    start of bit-array
  380. “    Yes    “    start and end of string
  381. ;    Yes    13    start of comment on a single line
  382. {    Yes    }    start of comment
  383. }    Yes    {    end of comment
  384. 32    Yes        space: delimiter
  385. 13    Yes        carriage return: delimiter
  386. \    Yes    \    force interning 
  387.  
  388.  
  389. 5.3 The .i.primitive expressions; in Help and derived forms
  390.  
  391. Every program Help is made of a sequence of definition expressed through define.
  392.  
  393. (.i.define; <ident> <any>)    Syntactic form    x
  394.  
  395. Allows to define <ident> as denoting <any>.
  396.  
  397. (.i.define; <closdef>  <body>)    Syntactic form    x
  398.  
  399. allows to define a closure. <body> is a sequnce of expression (body of the  closure). <closdef> is a a list whose CAR should be an identifier (name of the closure defined) . The CDR should be a formal parameters “list”  (Cf. lambda)
  400.  
  401.  
  402. 5.3.1 Litteral references  (constants, “quoted” symbols …)
  403.  
  404.  
  405. (.i.quote; <any>)    Syntactic form    x
  406. (’ <any>)    Syntactic form    x
  407.  
  408. Return the object whose external representation is <any>. It is used to reference litterals in the Help code. (quote <x>) may be abbreviated to  ‘<x>.
  409.  
  410. (quote (+ 1 2))    fl (+ 1 2)
  411.  
  412. <constant>    Syntactic form    x
  413.  
  414. Return the objetc whose external representation is <constant> (constant objects). It is used to reference litterals in the Help code. 
  415.  
  416. †    fl †
  417. 1    fl 1
  418.  
  419. 5.3.2 Variables references
  420.  
  421. <ident>    Syntactic form    x
  422.  
  423. The value returned is the value found at the location which is bound to the identifier in the current environment. If the variable is not bouns, the error?:varundef is returned.
  424.  
  425.  
  426. 5.3.3 Closure application
  427.  
  428. (<operator> <operand1>…)    Syntactic form    x
  429.  
  430. Closure application is simply expressed by writing the operator (closure) and the operands between parenthesis. The <operator>  is evaluated, but the <operand1>…  will be evaluated only if they are “used” (call by need).
  431.  
  432. (+ 1 2)                fl  3
  433. ((0 (list - +)) 32 10)    fl  22
  434.  
  435. Many closures are predefined. The user may define new closures through the syntactic form (lambda…). Please note that fixsize numbers are actually considered as closures. The positive fixnums select the “nth” element in a sequence (bit array, list, vector…). Negative fixnums return the “-nth” cdr of a list.
  436.  
  437. (0 ‘[a b c])            fl  a
  438. (-3 ‘(z y x w v u))        fl  (w v u)
  439.  
  440.  
  441. 5.3.4 Closure creation
  442.  
  443. (.i.lambda; <formals> <body>)    Syntactic form    x
  444.  
  445. Returns a closure holding  (among others) the environment that existed when the lambda expression was defined (captured environment). When the closure will be applied to effective arguments, its <body> will be evaluated in the capturated environment extended with the bindings of the <formals> to fresh locations holding the effective arguments. The value returned is the value of the last expression evaluated. If the <body> is empty, error ? is returned.
  446.  
  447. <formals> should take one of the following form:
  448.  
  449. •    (<ident1> … <identn>): The closure will have fixed arity “n”. When applied, each parameter will be bound to each argument. 
  450. •    <ident>: The closure will have variable arity. When applied the formal will be bound to a newly allocated list of the arguments.
  451. •    (<ident1> … | <identn>): The closure will have variable arity, (n-1) arguments at least. The last formal parameter will be bond to a newly allocated list of exceding arguments.
  452.  
  453.  <body> is a sequence of expression.
  454.  
  455. (lambda(x) x)                fl  {Closure (x) x) in ()}
  456. ((lambda x x) 1 2 3)            fl  (1 2 3)
  457.  
  458. 5.3.5 Conditional
  459.  
  460. The syntactic form COND is only there for efficiency (considering its frequent use). A fully compiled release of Help would allow the suppression of this form.
  461.  
  462. (.i.cond; <clause1>…)    Syntactic form    x
  463.  
  464. Each <clause> is a sequence of two expressions, the last <clause> may be restricted to a sequence of one expression.
  465.  
  466.  
  467. The first expression of the first <clause> is evaluated. If it returns a FALSE value (ƒ), then the following clause is handled (if any, oterwise it returns ƒ). If it returns an error, then this error is returned, else the vlaue of the second expression in the <clause>  is returned (if any, else first expression value is returned).
  468.  
  469. (cond (=? 2 (1+ 1)) “Yes” “No way”)    fl  Yes
  470. (cond (>? -3 0) -3
  471.       (<? -3 -5) (- 0 -3)
  472.       (+ 2 2))                    fl  4
  473.  
  474. 5.3.6 Assignment
  475.  
  476. (.i.=!; <ident> <any>)    Syntactic form    x
  477.  
  478. The location whose <ident> is bound to will receive the value of <any> in the current environment. This Syntactic form is one of the “non functionnal” feature of Help. 
  479.  
  480. (=! x 2)        fl  2
  481. (=! z (cons 1 z))    fl  (1 1 1 1 1 1 1 …)
  482.  
  483.  
  484. 5.3.7 Non-memoïzing suspension
  485.  
  486. (.i.nomemo; <boolean> <any>…)    Syntactic form    x
  487.  
  488. The forms <any> are evaluated one after the other. According to <boolean> value, every suspension that could be created by these forms will be a definitive (true) or memoïzed suspension… One should note that definitive (i.e. not memoïzed) suspensions are nevertheless easily “memoïzable” from “above”. If a suspension s1 created by nomemo is itself classically suspended (getting s2) , any access to the suspension s2 will induce s1 evaluation and the memoïzation of its value in s2 forbidding any new evaluation of s1 via s2.
  489.  
  490. (define z
  491.    (nomemo † (cons (print “CAR”)
  492.                    (print “CDR”))))        
  493. z                            fl  (? | ?)
  494.                                 prints “CAR” et “CDR”
  495. z                            fl (? | ?)
  496.                                  prints  “CAR” et “CDR”
  497. (define zz (list z z))
  498. zz                            fl  ((? | ?) (? | ?))
  499.                                 prints  “CAR”, “CDR” (twice)
  500. zz                            fl  ((? | ?) (? | ?))
  501.                                 prints nothing…
  502.  
  503. 5.3.9 Environment
  504.  
  505. (.i.bindings;)    Syntactic form    x
  506.  
  507. Returns the current environment. If it is the top level environment, the symbol () is returned. This form can NOT be a closure because the body of the closures are evaluated in the captured environment, but not in the current environment wich is inaccessible for them.
  508.  
  509. (bindings)                    fl ()
  510. ((lambda(x) (bindings)) 1)            fl {Env: «x=1» Then ()}
  511.  
  512.  
  513. 5.3.10 Defining macros
  514.  
  515. (.i.defmacro; <any>)    Syntactic form    x
  516.  
  517. Allows the definition of macros The syntax is identical to define syntax. When interpreting, any macro call is physically replaced (via car=!) by the value returned  upon the first evaluation (displacing macros). When the compiler is used, macros are expanded when compiling. It is therefore necessary to define macros before their use.
  518.  
  519. (defmacro (mapause m)
  520.    `(begin (prin “Pause à “)
  521.            (print ‘,m)
  522.            (pause)))
  523. (define (test n)(mapause test)(1+ n))
  524. Après a exécution:
  525. test            fl {Closure:((n) (begin (prin “Pause à “)
  526.                                          (print ‘test)
  527.                                            (pause)) (1+ n)))…}
  528.  
  529. 5.3.10 Defining external functions
  530.  
  531. (.i.defext; <fic><seg><nom><str> | <par>)    Syntactic form    x
  532.  
  533. Allows the importation of external functions (assembly langage for example, see in the “Divers” folder). The external code (written under MPW) must follows conventions given in the §4.5.1.3.1.2, qnd must be linked to the LibHelp.o library…(see folder “Divers”).
  534. The parameters are:
  535.  
  536. t    <fic>    file name (CODE ressources);
  537. t    <seg>    name of the segment containing the closure code;
  538. t    <nom>    name for the closure to be defined
  539. t    <str>    stricness bit vector (Cf setstrict)
  540. t    <par>    parameters of the external closure (as for define)
  541.         
  542. 5.3.11 Creating bindings
  543.  
  544. (.i.let; <bindings> <body>)    Syntactic form    x
  545.  
  546. The <body> is evaluated in the current environment extended with the <bindings>. The scope of the bindings is limited to the <body>.
  547.  
  548. <bindings> is a vector of lists that can take the following forms:
  549.  
  550. • (<ident> <any>): <ident> will be (lazily)  bound to the value of <any>.
  551. • (<closdef> <corpsclos>): allows to define a local closure (non recursive closure because of the scope of the bindings) more easily than by using a lambda expression. <corpsclos> is a sequence of any expressions, <closdef> is a list whose CAR should be an identifier (name of the  closure defined) and whoseCDR should be a “list” of formal parameters (Cf. lambda).
  552.  
  553. (let [(x 1.1)
  554.       ((double n)(+ n n))]
  555.      (double x))                fl 2.200000000000000e+00
  556.  
  557.  
  558. (.i.letrec; <bindings> <body>)    Syntactic form    x
  559.  
  560. The syntax is the same as for the let but the scope of the bindings created is equal to the lexical union of the <bindings> and the <body>. It is possible (as for the let) to define local functions (that can, here use recursion). Because of lazyness, there is no problem (as there are in Scheme by the way) in defining objetcs that immediately refer to identifier bound by the letrec . 
  561.  
  562. (let [(r (fib 20))            ;error en Scheme
  563.       ((fib n)                ;(fib undefined function)
  564.         (cond (<? n 2) 1
  565.               (+ (fib (1- n))(fib (- n 2)))))]
  566.      r)                    fl 10946
  567.  
  568. 5.3.12 Sequence
  569.  
  570. (.i.begin; <any1>…)    Syntactic form    x
  571.  
  572. The <any1> are evaluated one after the other…. Allows to group evaluations so that they may all be executed “at the same time”. This is especially useful when interacting with the user.
  573.  
  574. (let [(x (begin (prin “Entrez x”)(read)))]
  575.      (traiter x))                fl …according to traiter
  576.  
  577. 5.3.12 .i.Debugging
  578.  
  579. The .i.error handling; system of Help, because of the lazyness (that allows to build objects partially), does not stop the evaluation upon  error. According to the “evaluation mode”, an error may:
  580.  
  581. t    return an error object which is passed to the current continuation (ƒ  mode);
  582. t    return an error object which is passed to the current continuation and print an error message on the stder input/output unit (() mode);
  583. t    put the Help evaluator in a debug mode († mode).
  584.  
  585. (.i.pause;)    Syntactic form    x
  586.  
  587. Simply stop the cuurent evaluation and give the user the opportunity to use a new READ-EVAL-PRINT loop with a prompt  whose form will be “{n}† “ where n is the depth of  pauses. The loop will be abandonned as soon as the symbol † is evaluated (therefore, and because of the prompt appearance, it is enough to type the ENTER key to exit the loop). Any action is possible during the loop . The value returned is the symbol ? (undefined error).
  588.  
  589. (.i.warn; <ident> <any1>…)    Syntactic form    x
  590.  
  591. Evaluate the <any1>… in the evaluation mode specified by <ident> (Cf 5.3.12). One should note that suspended form that may be build will efectively be evaluated in the specified mode upon access, even if one as gone out of the  warn expression (suspended form do capture evaluation mode).
  592.  
  593. The debugger is actually a simple READ-EVAL-PRINT (Cf pause) that may be abandonned (to resume execution) by reading the symbol † (true). The expression and the value that (probably) are the reason for the error are printed. The closures and syntactic forms bindings, envar, stack… allow the user to look at the environment, the stack, values… The closure break will bring the user back to TopLevel. One should note that evaluating  (under debugger) may force suspensions that should not have been forced and therefore may modify the program behaviour. A not fully functionnal program may be greatly disturbed by such inspections.
  594.  
  595. (warn ƒ (+ 0 ‘a))            fl     ?:bad-type
  596.                             et aucun message d’error
  597.  
  598. (.i.step; <boolean> <any1>…)    Syntactic form    x
  599.  
  600. According to <boolean> value, will (or not) evaluate the <any1>… step by step.  One should note that suspended form will be evaluated step by step even if the control is out of the step scope (suspensions capture the current evaluation mode, including step or not mode). At each step, the function step? (user defined) is called with the form being evaluated and the current environment. If the value returned is flase (ƒ), step by step evaluation does not actually take effect for this form. Otherwise, the closure stepin is called with he form being evaluated and the current environment. The value returned is then given along with the value of the stepped through form to the stepout (user defined) closure. Predefined step?, stepin and stepout closures are proposed in the “Stepper” file. The main purpose of the boolean argument is to desactivate stepping locally.
  601.  
  602. Example:
  603.  
  604. (step † (+ 1 2))            fl     3  and the following session (for example):
  605. -> "(+ 1 2)"{1}† 
  606. -> "+"{1}† 
  607. <- "{Closure:{Code 680xx for +} Env:()}"{1}† 
  608. -> "1"{1}† 
  609. <- "1"{1}† 
  610. -> "2"{1}† 
  611. <- "2"{1}† 
  612. <- "3"{1}† 
  613. { = 3 }
  614.  
  615. The step by step mode is really very useful and powerful using the step?, stepin and stepout closures (and to the (step ƒ …) form that allows local steppin’ desactivation).
  616.  
  617. For example, using the following definition for step?:
  618.  
  619. (define (step? f e) 
  620.    (not (number? f)))
  621.  
  622. The previous step by step evaluation becomes:
  623.  
  624. (step † (+ 7 12))        fl     19 and the following session (for example):
  625. 1 -> "(+ 7 12)"{1}† 
  626. 2 -> "+"{1}† 
  627. 2 <- "{Closure:{Code 680xx for +} Env:()}"{1}† 
  628. 1 <- "19"{1}† 
  629. { = 19 }
  630.  
  631. 5.4 Predefined .i.closures; in Help
  632.  
  633. 5.4.1 Booleans
  634.  
  635. The two constants † and ƒ denote .i.booleans;. Nevertheless, in ANY test actually made by Help, any value that is not equal to ƒ is considered as true (except for errors, in this case the test fails and returns the error itself). Pay attention the the EMPTY LIST is actually true !
  636.  
  637. (.i.not; any)    Closure:ProcN    1
  638.  
  639. Returns † (true) if any   is equal to ƒ, otherwise returns ƒ.
  640.  
  641. (not †)            fl ƒ
  642. (not 3)            fl ƒ
  643. (not (list 1 2))    fl ƒ
  644. (not ƒ)            fl †
  645. (not ‘())        fl ƒ
  646.  
  647. (.i.boolean?; any)    Closure:ProcN    1
  648.  
  649. Returns † (true) if any  is equal to † or ƒ. Returns ƒ otherwise.
  650.  
  651. (boolean? †)        fl †
  652. (boolean? 3)        fl ƒ
  653.  
  654. 5.4.2 Equivalence predicates
  655.  
  656. The three .i.equivalence predicates; eq?, =? and equal? define three equivalence relations (reflexive, symetric transitive) on the Help objects. The relation defined by eq? is included in the relation defined by =? itself included in the relation defined by equal?.
  657.  
  658. (.i.eq?; any1 any2)    Closure:ProcN    2
  659.  
  660. Returns † (true) if the two objetcs are actually the same one (i.e exist at the same location in memory). Returns ƒ otherwise. Because of their unicity, this predicate is especially useful for symbols.
  661.  
  662. (eq? ‘a ‘a)        fl †
  663. (eq? 1 2)        fl ƒ
  664. (eq? 1 1)        fl undefined, probably false
  665.  
  666. (.i.neq?; any1 any2)    Closure:ProcN    2
  667.  
  668. Returns ƒ (false) if the two objetcs are actually the same one (i.e exist at the same location in memory). Returns † otherwise. Because of their unicity, this predicate is especially useful for symbols.
  669.  
  670. (neq? ‘a ‘a)        fl ƒ
  671. (neq? 1 2)        fl †
  672. (neq? 1 1)        fl undefined, probably true
  673.  
  674. (.i.=?; any1 any2)    Closure:ProcN    2
  675.  
  676. Returns † (true) if both objects are the same (i.e same address in memory) or if they have the same content (according to eq? for data structures (eg. conses, vectors) referencing other objects). Returns ƒ otherwise. This predicate is especially useful for numbers, bit-arrays and strings and in some cases for vectors or conses (lists or cells of symbols…).
  677.  
  678. (=? ‘a ‘a)        fl †
  679. (=? 1 2)        fl ƒ
  680. (=? 1 1)        fl †
  681. (=? %01 %01)        fl †
  682. (=? ‘[a a] ‘[a a])    fl †
  683.  
  684. (.i.<>?; any1 any2)    Closure:ProcN    2
  685.  
  686. Returns ƒ (false) if both objects are the same (i.e same address in memory) or if they have the same content (according to eq? for data structures (eg. conses, vectors) referencing other objects). Returns † otherwise. This predicate is especially useful for numbers, bit-arrays and strings and in some cases for vectors or conses (lists or cells of symbols…).
  687.  
  688. (<>? ‘a ‘a)                fl ƒ
  689. (<>? 1 2)                fl †
  690. (<>? 1 1)                fl ƒ
  691. (<>? %01 %01)                fl ƒ
  692. (<>? ‘(a | b) ‘(a | b))        fl ƒ
  693.  
  694. (.i.equal?; any1 any2)    Closure:ProcN    2
  695.  
  696. Returns † (true) if both objects are equivalent (in the sens of =?) or, otherwise, if their content is equivalent (in the sens of equal?). Returns ƒ otherwise. 
  697.  
  698. (equal? ‘a ‘a)            fl †
  699. (equal? 1 1)            fl †
  700. (equal? ‘(a b) ‘(a b))    fl †
  701.  
  702. (.i.nequal?; any1 any2)    Closure:ProcN    2
  703.  
  704. Returns ƒ (false) if both objects are equivalent (in the sens of =?) or, otherwise, if their content is equivalent (in the sens of equal?). Returns † otherwise. 
  705.  
  706. (nequal? ‘a ‘a)        fl ƒ
  707. (nequal? 1 1)            fl ƒ
  708. (nequal? ‘(a b) ‘(a b))    fl ƒ
  709.  
  710.  
  711. 5.4.3 Lists and .i.conses
  712.  
  713. A cons (or pointed pair) is an heterogenous data structures made of two fields called (for good old reasons i won’t bother you with…) CAR and CDR (pronounce could’er). This structures are actually mutable.  Accessing the fiels is done through “numerical selectors”.
  714.  
  715. The main use of conses is to represent .i.lists;. A list is defined as being either the empty list () or a cons whose  CDR is a list. 
  716. The empty list () is a special object actually denoted by a constant symbol. It contains no element and its length is 0.
  717.  
  718. (.i.list?; any)    Closure:ProcN    1
  719.  
  720. Returns ƒ (false) if any  is not a list (i.e. a cons or the symbol (), dotted lists are considered as lists). Returns † otherwise.
  721.  
  722. (list? ‘())        fl †
  723. (list? ‘(1 2 3))    fl †
  724. (list? 3)        fl ƒ
  725.  
  726. (.i.cons?; any)    Closure:ProcN    1
  727.  
  728. Returns † (true) if any  is a cons. Returns ƒ otherwise.
  729.  
  730. (cons? ‘())        fl ƒ
  731. (cons? ‘(1 2 3))    fl †
  732. (cons? 3)        fl ƒ
  733.  
  734. (.i.atom?; any)    Closure:ProcN    1
  735.  
  736. Returns ƒ (false) if any  is a cons. Returns † otherwise.
  737.  
  738. (atom? ‘())        fl †
  739. (atom? ‘(1 2 3))    fl ƒ
  740. (atom? 3)        fl †
  741.  
  742. (.i.cons; any1 any2)    Closure:ProcN    2
  743.  
  744. Returns a newly allocated cons whose CAR contains any1  value and whose CDR  contains any2  value.  The cons is different 5  of any existing object.
  745.  
  746. (cons 1 2)        fl (1 | 2)
  747. (cons ‘a ‘())        fl (a)
  748. (cons ‘(a b) ‘c)    fl ((a b) | c)
  749.  
  750.  
  751. (.i.car=!; cons any)    Closure:ProcN    2
  752.  
  753. Allows to write tha value ofany  in the CAR of a cons. Because of lazyness, unexpected effects may be observed. This closure is therefore very dangerous. It may disappear from future releases.
  754.  
  755. (car=! ‘(1 2) 3)    fl (3 2)
  756. (car=!  %1010 3)    fl ?:bad-type
  757.  
  758. (.i.cdr=!; cons any)    Closure:ProcN    2
  759.  
  760. Allows to write tha value ofany  in the CDR of a cons. Because of lazyness, unexpected effects may be observed. This closure is therefore very dangerous. It may disappear from future releases.
  761.  
  762. (cdr=! ‘(1 2) 3)    fl (1 | 3)
  763. (cdr=!  %1010 3)    fl ?:bad-type
  764.  
  765. (.i.null?; any)    Closure:ProcN    1
  766.  
  767. Returns ƒ (false) if any  value is not equal to the empty list. Returns † otherwise.
  768.  
  769. (null? ‘())        fl †
  770. (null? ‘(1 2 3))    fl ƒ
  771.  
  772. (.i.list; any …)    Closure:NProc    0
  773.  
  774. Returns the list of the arguments values.
  775.  
  776. (list ‘ts (+ 24 3) ‘65)    fl (ts 27 65)
  777. (list)                fl ()
  778.  
  779. (.i.length; list)    Closure:ProcN    1
  780.  
  781. Returns the length of list. The length of a list is defined by:
  782. t    the length of the empty list is 0;
  783. t    the length of a cons is 1 plus the length of its  CDR.
  784.  
  785. (length ‘())                fl 0
  786. (length ‘(1 2 3))            fl 3
  787. (length ‘(mcl (1 2 3) (a b)))    fl 3
  788. (length 1)                fl ?:bad-type
  789.  
  790.  
  791. (.i.append; list1 any)    Closure:ProcN    2
  792.  
  793. Returns a list made of the elements of the first listlist1  followed by the elements of the list any. The second arg. (any) may be something else than a list.
  794.  
  795. (append ‘(1 2 3) ‘(4 5 6))    fl (1 2 3 4 5 6)
  796. (append ‘() ‘(a b))        fl (a b)
  797. (append ‘(a b) ‘(c | d))    fl (a b c | d)
  798.  
  799. (.i.∞; any)    Closure:ProcN    1
  800.  
  801. Returns an infinite list whose elements are all equal to the value of any.
  802.  
  803. (∞ 1)        fl (1 1 1 1 1 1…)
  804. (∞ (+ 2 3))    fl (5 5 5 5 5 5…)
  805.  
  806. (.i.…; number)    Closure:ProcN    1
  807.  
  808. Returns a n infinite list made of the integers after number.
  809.  
  810. (… 1)        fl (1 2 3 4 5 6…)
  811. (… (- -2 1))    fl (-3 -2 -1 0 1 2…)
  812.  
  813.  
  814. 5.4.4 Symbols
  815.  
  816. The .i.symbols; main property is that two identical symbols (micro-syntax) are actually identical in memory (in the sens of eq? ). This property is very useful to represent variables, constant identifiers, keywords. Help also use symbols to denote errors.
  817.  
  818. (.i.symbol?; any)    Closure:ProcN    1
  819.  
  820. Returns † (true) if any  is a symbol, otherwise returns the object any.
  821.  
  822. (.i.intern; symbol any)    Closure:ProcN    2
  823.  
  824. Returns a symbol whose name is any  value (that should be a string or a symbol)  and whose father (in the symbols hierarchy) is symbol.
  825.  
  826. (intern ‘père “fils”)    fl père:fils
  827. (intern ‘père ‘fils)    fl père:fils
  828.  
  829.  
  830. 5.4.5 Numbers
  831.  
  832. According to their position, .i.numbers; may be interpreted as closures (numerical selectors) or as numerical data. This double point of view may be considered as a semantical weakness but is of great ease (very useful from a pragmatical point of view).
  833.  
  834. For numerical selectors see §5.3FR.
  835.  
  836. (.i.+; number number)    Closure:ProcN    2
  837.  
  838. Returns the sum of its arguments values. If one of the numbers is a floating, the result will be floating. 
  839.  
  840. (+ 10 10)        fl 20
  841. (+ 1 2.312)        fl 3.312000000000000e+00
  842. (+ 9999999999 1)    fl 10000000000
  843. (+ 1 ‘a)        fl ?:bad-type
  844.  
  845. (.i.-; number number)    Closure:ProcN    2
  846.  
  847. Returns the difference of its arguments values. If one of the numbers is a floating, the result will be floating. 
  848.  
  849. (- 10 10)        fl 0
  850. (- 2.312 1)        fl 1.312000000000000e+00
  851. (- 9999999999 1)    fl 9999999998
  852. (- 1 ‘a)        fl ?:bad-type
  853.  
  854. (.i.1+; number)    Closure:ProcN    1
  855.  
  856. Returns one plus its argument value. If the number is a floating, the result will be floating. 
  857.  
  858. (1+ 10)        fl 11
  859. (1+ %)        fl %00000000000000000000000000000001
  860. (1+ ‘a)        fl ?:bad-type
  861.  
  862. (.i.1-; number)    Closure:ProcN    1
  863.  
  864. Returns its argument value minus one. If the number is a floating, the result will be floating. 
  865.  
  866. (1- 10)        fl 9
  867. (1- ‘a)        fl ?:bad-type
  868.  
  869. (.i.*; number1 number2)    Closure:ProcN    2
  870.  
  871. Returns the product of its arguments values. If one of the numbers is a floating, the result will be floating. 
  872.  
  873. (* 10 23)    fl 230
  874. (* ‘a 2)    fl ?:bad-type
  875. (* 1e10 2)    fl 2.000000000000000e10
  876.  
  877. (.i./; smallnum1 smallnum2)    Closure:ProcN    2
  878.  
  879. Returns the result from the division of its arguments values. If one of the numbers is a floating, the result will be floating. If both numbers are integers, the result will be an integer.
  880.  
  881. (/ 23 10)        fl 2
  882. (/ ‘a 2)        fl ?:bad-type
  883. (/ 23 10.0)        fl 2.300000000000000e0
  884.  
  885. (.i.modulo; fix1 fix2)    Closure:ProcN    2
  886.  
  887. Returns the remainder of the division of fix1   value by fix2   value.
  888.  
  889. (modulo 23 10)    fl 3
  890. (modulo ‘a 2)    fl ?:bad-type
  891.  
  892. (.i.<?; number1 number2)    Closure:ProcN    2
  893.  
  894. Returns ƒ if  number1   value is not strctly less than number2   value. Returns number1  value otherwise.
  895.  
  896. (<? 23 10)        fl ƒ
  897. (<? ‘a 2)        fl ?:bad-type
  898. (<? 12 20)        fl 12
  899.  
  900. (.i.>?; number1 number2)    Closure:ProcN    2
  901.  
  902. Returns ƒ if  number1   value is not strctly more than number2   value. Returns number1  value otherwise.
  903.  
  904. (>? 23 10.0)            fl 23
  905. (>? ‘a 2)            fl ?:bad-type
  906. (>? 20 12345678987654321)    fl ƒ
  907.  
  908. (.i.zero?; number)    Closure:ProcN    1
  909.  
  910. Returns ƒ if  number value is not equal to zero. Returns number  otherwise. 
  911.  
  912. (zero? 0)        fl 0
  913. (zero? ‘a)        fl ?:bad-type
  914.  
  915. (.i.float; number)    Closure:ProcN    1
  916.  
  917. Converts number  value to floating.
  918.  
  919. (float 0)        fl 0.00000000000e+0
  920.  
  921. (.i.cos; number)    Closure:ProcN    1
  922.  
  923. Returns the cosinus (floating) of number  value in radians.
  924.  
  925. (.i.sin; number)    Closure:ProcN    1
  926.  
  927. Returns the sinus (floating) of number  value in radians.
  928.  
  929. (.i.tan; number)    Closure:ProcN    1
  930.  
  931. Returns the tangent (floating) of number  value in radians.
  932.  
  933. (.i.acos; number)    Closure:ProcN    1
  934.  
  935. Returns the arc-osinus (floating) of number  value in radians.
  936.  
  937. (.i.asin; number)    Closure:ProcN    1
  938.  
  939. Returns the arc-sinus (floating) of number  value in radians.
  940.  
  941. (.i.atan; number)    Closure:ProcN    1
  942.  
  943. Returns the arc-tangent (floating) of number  value in radians.
  944.  
  945. (.i.cosh; number)    Closure:ProcN    1
  946.  
  947. Returns the hyperbolic cosinus (floating) of number  value.
  948.  
  949. (.i.sinh; number)    Closure:ProcN    1
  950.  
  951. Returns the hyperbolic sinus (floating) of number  value.
  952.  
  953. (.i.tanh; number)    Closure:ProcN    1
  954.  
  955. Returns the hyperbolic tangent (floating) of number  value.
  956.  
  957. (.i.atanh; number)    Closure:ProcN    1
  958.  
  959. Returns the hyperbolic arc-tangent (floating) of number  value.
  960.  
  961. (.i.log; number)    Closure:ProcN    1
  962.  
  963. Returns the neperian logarithm (floating) of number  value.
  964.  
  965. (.i.exp; number)    Closure:ProcN    1
  966.  
  967. Returns the exponential (floating) of number  value.
  968.  
  969. (.i.sqrt; number)    Closure:ProcN    1
  970.  
  971. Returns the square root (floating) of number  value.
  972.  
  973. (.i.ibase; fixpos)    Closure:ProcN    1
  974.  
  975. Modifies lthe current reading numerical base of the reader. The fixpos  value should be between 2 and 36. Returns its argument value. Cf §5.2.1FR.
  976.  
  977. (ibase 10)        fl 10
  978.  
  979. 5.4.6 Closures
  980.  
  981. The closures are made of a “code” that is waiting for a sequence of expressions and from an environment. For optimisation, each closure contains a 16 bits bit-array to express the closure strictness with respect to the  15 first arguments (15 first bits) and the following one (last bit). This bit-array is automatically filled by the compiler (to some extent only), but not at all by the interpreter.
  982.  
  983.  
  984. (.i.apply; applicable list)    Closure:ProcN    2
  985.  
  986. Applies the closure or the numerical selector applicable  to the list of argument list. 
  987.  
  988. (apply 1 ‘((a)))        fl a
  989. (apply + ‘(1 2))        fl 3
  990.  
  991. (.i.getcode; closure)    Closure:ProcN    1
  992.  
  993. Returns the code (interpreted or compiled) of the closure.
  994.  
  995. (getcode 1+)            fl {Code 680xx for 1+}
  996. (getcode (lambda(x)x))    fl ((x) x)
  997.  
  998. (.i.getenv; closure)    Closure:ProcN    1
  999.  
  1000. Returns the closure  captured environment.
  1001.  
  1002. (getenv 1+)            fl ()
  1003. (getenv
  1004.    (let [(x 2)]
  1005.       (lambda(x)x)))        fl {Env: «x=2» Then ()}
  1006.  
  1007. (.i.getstrict; closure)    Closure:ProcN    1
  1008.  
  1009. Returns the bit-array associated to the closure  that gives the closure strictness (see above).
  1010.  
  1011. (getstrict cons)        fl %00000000000000000000000000000000
  1012. (getstrict +)            fl %11000000000000000000000000000000
  1013.  
  1014. (.i.setstrict; closure bitarray)    Closure:ProcN    2
  1015.  
  1016. Allows the user to give the strictness of the closure . May lead to important (10-20%) improvements in execution time and memory usage if strict.
  1017.  
  1018. 5.4.7 Macros
  1019.  
  1020. (.i.expand; list)    Closure:ProcN    1
  1021.  
  1022. The list  should be a “quoted” macro call. Returns the result of the  macro expansion.
  1023.  
  1024. (expand ‘(quasiquote (a (unquote b))))    fl (list ‘a b)
  1025.  
  1026.  
  1027. 5.4.8 Cells (or vectors)
  1028.  
  1029. The .i.vectors; are heterogenous structures indexed by integers. These structures (as conses) are mutable. Because of lazyness, mutation is potentially dangerous.
  1030.  
  1031. When accessed using “nemerical selectors”, vectors are indexed from 0 (first element) to the vector length minus one. the length of a vector is obtained using closure blength and then by substracting one from the result.
  1032.  
  1033.  
  1034. (.i.cell?; any)    Closure:ProcN    1
  1035.  
  1036. Returns ƒ (false) if any   is not a vector, otherwise returns the vector itself.
  1037.  
  1038. (cell? 23)        fl ƒ
  1039. (cell? [1 2 3])    fl [1 2 3]
  1040.  
  1041. (.i.cell; any …)    Closure:NProc    0
  1042.  
  1043. Returns a vector whose content is any ….
  1044.  
  1045. (cell 0 1 2)            fl [0 1 2]
  1046. (cell ‘d ‘e 1 ‘(a) [1])    fl [d e 1 (a) [1]]
  1047.  
  1048. (.i.makecell; fixpos)    Closure:ProcN    1
  1049.  
  1050. Returns a vector having size fixpos  and whose fields are all initialized to ?.
  1051.  
  1052. (makecell 2)            fl [? ?]
  1053.  
  1054. (.i.cell=!; vector fixpos any)    Closure:ProcN    3
  1055.  
  1056. Writes any in the vector, position fixpos. Returns the vector. This non-funtionnal closure has unexpected effects when used (because of Help lazyness).
  1057.  
  1058. (cell=! ‘[a b c] 0 0)    fl [0 b c]
  1059. (cell=! [0 1 2] 3 1)    fl ?:indx-out
  1060.  
  1061.  
  1062. 5.4.9 Environments
  1063.  
  1064. The Syntactic form bindings allos one to access the current .i.environnement;. Some closures allows then to handle these environments, or to create new ones. Numerical selectors allows one to access environment contents (non empty env.). If N is the blength of the environment, the following indexes are valid: 
  1065. • Index 0: the lower environment (previous frame);
  1066. • from 1 to (N-2)/2: the values of the variables bound in the environment;
  1067. • from (N-2)/2+1 to N-1: the identifiers of the variables bound.
  1068.  
  1069. Note that the compiler may rely on so-called “short-environments” that do not contains names variables, only their values.
  1070.  
  1071. (.i.environment?; any)    Closure:ProcN    1
  1072.  
  1073. Returns ƒ (false) if any  is not an environment, otherwise returns the environment itself. as the Syntactic form bindings returns () if the current enviroement is the toplevel environment, the empty  list is considered to be an environment.
  1074.  
  1075. (environment? 23)                fl ƒ
  1076. (environment? ‘())                fl ()
  1077. (environment (let [(x 2)] (bindings)))    fl {Env: «x=2» Then ()}
  1078.  
  1079. (.i.binding=?; ident environ)    Closure:ProcN    2
  1080.  
  1081. Returns the value of ident  in environ . If the variable is undefined in the environment, The error  ?:varundef is returned.
  1082.  
  1083. (binding=? ‘1+ ‘())                fl {Code6800x for 1+}
  1084. (binding=? ‘x (let [(x 2)] (bindings)))    fl 2
  1085. (binding=? ‘a ‘())                fl ?:varundef
  1086.  
  1087. (.i.binding=!; ident environ any)    Closure:ProcN    3
  1088.  
  1089. Modifies the value of ident  in environ. Returns the value of environ.
  1090.  
  1091. (binding=! ‘1+ ‘() 2)            fl ()
  1092. (binding=! ‘a ‘() 2)            fl ()
  1093.  
  1094. (.i.makeenv; ident1 …)    Closure:NProc    0
  1095.  
  1096. Returns an environment where the ident are all bound to ?. This environment is automatically linked to the current environnement (the lower frame will be the current env).
  1097.  
  1098. (makeenv ‘a ‘b)    fl {Env: «a=?» «b=?» Then ()}
  1099. (makeenv 1)        fl ?:bad-type
  1100.  
  1101. (.i.envar; environ)    Closure:ProcN    1
  1102.  
  1103. Returns a vector that contains all the identifiers of the environment environ.  Especially useful during debugging  to have a look at an anvironment without forcing all the values referenced in the environment.
  1104.  
  1105. (envar (makeenv ‘a ‘b))    fl [a b]
  1106.  
  1107. 5.4.10 Bit-arrays
  1108.  
  1109. Bit arrays are especially useful to represent sets (and in AI for every “propositionnal logic oriented” software: a clause is simply two sets of litterals, i.e. two bit-arrays). The set-operations are efficiently managed (intersection, union…). Pay attention that bit-set operations are destructive for efficiency. A functionnal behaviour may be obtained using closure bcopy.
  1110.  
  1111. Bit-array reading is obtained through “numerical selectors” (index starting at 0).
  1112.  
  1113. (.i.bitarray?; any)    Closure:ProcN    1
  1114.  
  1115. Returns ƒ (false) if any  is not a bit-array, otherwise returns the array itself.
  1116.  
  1117. (bitarray? 23)    fl ƒ
  1118. (bitarray? %)    fl %
  1119.  
  1120.  
  1121. (.i.makebitarray; posfix)    Closure:ProcN    1
  1122.  
  1123. Returns a bit-array whose length is at least equal to posfix , all  bits cleared.
  1124.  
  1125. (makebitarray 0)    fl %
  1126. (makebitarray 10)    fl %00000000000000000000000000000000
  1127.  
  1128. (.i.bitand!; bitarray1 bitarray2)    Closure:ProcN    2
  1129.  
  1130. Logical AND between bitarray1  and  bitarray2. The result is stored in bitarray2. If the arrys have not the same siwze, the operation is restricted to the smaller argument. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1131.  
  1132. (bitand! %0011 %0101)    fl %00010000000000000000000000000000
  1133.  
  1134. (.i.bitor!; bitarray1 bitarray2)    Closure:ProcN    2
  1135.  
  1136. Logical OR between bitarray1  and  bitarray2. The result is stored in bitarray2. If the arrys have not the same siwze, the operation is restricted to the smaller argument. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1137.  
  1138. (bitor! %0011 %0101)    fl %01110000000000000000000000000000
  1139.  
  1140. (.i.bitxor!; bitarray1 bitarray2)    Closure:ProcN    2
  1141.  
  1142. Logical XOR between bitarray1  and  bitarray2. The result is stored in bitarray2. If the arrys have not the same siwze, the operation is restricted to the smaller argument. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1143.  
  1144. (bitor! %0011 %0101)    fl %01100000000000000000000000000000
  1145.  
  1146. (.i.bitnot!; bitarray)    Closure:ProcN    1
  1147.  
  1148. Logical NOT of bitarray.  The result is stored in bitarray. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1149.  
  1150. (bitnot! %01)    fl %10111111111111111111111111111111
  1151.  
  1152. (.i.bitcount; bitarray)    Closure:ProcN    1
  1153.  
  1154. Returns the number of bits set in bitarray. Execution time in the order of the number of bits set.
  1155.  
  1156. (bitcount %0101)    fl 2
  1157.  
  1158.  
  1159. (.i.bitfind; bitarray)    Closure:ProcN    1
  1160.  
  1161. Returns the position of the first bit set in bitarray  (if any). Returns ƒ otherwise.
  1162.  
  1163. (bitfind %0001)    fl 3
  1164. (bitfind %)        fl ƒ
  1165.  
  1166. (.i.bitset!; bitarray fixpos)    Closure:ProcN    2
  1167.  
  1168. Sets (to 1) the bit  at the position fixpos of  bitarray . Returns the bit-array. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1169.  
  1170. (bitset! %0 0)    fl %10000000000000000000000000000000
  1171.  
  1172. (.i.bitclr!; bitarray fixpos)    Closure:ProcN    2
  1173.  
  1174. Clears (to 0) the bit  at the position fixpos of  bitarray . Returns the bit-array. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1175.  
  1176. (bitclr! %1 0)    fl %00000000000000000000000000000000
  1177.  
  1178. (.i.bitchg!; bitarray fixpos)    Closure:ProcN    2
  1179.  
  1180. Flip the bit  at the position fixpos of  bitarray . Returns the bit-array. This operation is destructive, use bcopy if you need a “functionnal” behaviour.
  1181.  
  1182. (bitchg! %0 0)    fl %10000000000000000000000000000000
  1183.  
  1184. (.i.zero?; bitarray)    Closure:ProcN    1
  1185.  
  1186. Returns  ƒ if one of the bits of bitarray   is set. Returns bitarray  otherwise.
  1187.  
  1188. (zero? %00010)    fl ƒ
  1189. (zero? %000)    fl %00000000000000000000000000000000
  1190.  
  1191. 5.4.11 Entrées-Sorties
  1192.  
  1193. All input/output is done through so-called “.i.input/output; units”. These units may denote a file or a text window. As in C, the variables  .i.stdi;, .i.stdo ;et .i.stder ;denote the units (resp.) for input, output and error. Upon startup, stdi and stdo are bound to the “current selected window” and stder to the “Transcript” window. It is possible to modify the content of this variables to read/write to files…
  1194.  
  1195.  
  1196. (.i.read;)    Closure:ProcN    0
  1197.  
  1198. Reads a Help expression in the input-output unit in stdi. Returns the internal representation of the expression read.
  1199.  
  1200. (.i.print; any)    Closure:ProcN    1
  1201.  
  1202. Print the external representation of the object any   on the current output i/o unit (contained in the variable stdo) and then prints a carriage return. One should note that Help printer will force every suspended form in the object (so as to print the object in its completeness). If you need to print an object without forcing its content, use closure printdebug. Returns ?.
  1203.  
  1204. (.i.prin; any)    Closure:ProcN    1
  1205.  
  1206. Print the external representation of the object any   on the current output i/o unit (contained in the variable stdo). One should note that Help printer will force every suspended form in the object (so as to print the object in its completeness). If you need to print an object without forcing its content, use closure printdebug. Returns ?.
  1207.  
  1208. (.i.prinlength; fixpos)    Closure:ProcN    1
  1209.  
  1210. The max. printing length (in number of printed objects) is set to fixpos. Especially useful to print (partially) infinite objects. Returns the value of its argument.
  1211.  
  1212.  
  1213. (.i.prindepth; fixpos)    Closure:ProcN    1
  1214.  
  1215. The max. printing depth (in number of printed objects) is set to fixpos. Especially useful to print (partially) infinite objects. Returns the value of its argument.
  1216.  
  1217. (.i.openi; string)    Closure:ProcN    1
  1218.  
  1219. Opens a file for reading only. The path is given in string . It must be specified using “:” to separate folders. The startup folder is the “default” folder. Returns an input-output unit associated to the file.
  1220.  
  1221. (openi “HD:Help:bob”)    fl «IO-Unit»
  1222.  
  1223. (.i.openo; string)    Closure:ProcN    1
  1224.  
  1225. Opens a file for writing only. The path is given in string . It must be specified using “:” to separate folders. The startup folder is the “default” folder. Returns an input-output unit associated to the file.
  1226.  
  1227. (openo “HD:Les:deux-pierre(s)”)    fl «IO-Unit»
  1228.  
  1229. (.i.close; iounit)    Closure:ProcN    1
  1230.  
  1231. Closes the file associated to the iounit . Returns ?. Every attempt to read/write to a closed i-o unit will return a ?:bad-type error.
  1232.  
  1233. (.i.prinio; any  iounit)    Closure:ProcN    2
  1234.  
  1235. IPrint the external representation of the object any   on the output i/o unit iounit. One should note that Help printer will force every suspended form in the object (so as to print the object in its completeness). If you need to print an object without forcing its content, use closure printdebug. Returns ?.
  1236.  
  1237. (.i.readio; iounit)    Closure:ProcN    1
  1238.  
  1239. Reads a Help expression in the input-output unit iounit. Returns the internal representation of the expression read. Returns error ?:eof-error when end of file is reached.
  1240.  
  1241. (.i.flushio; iounit)    Closure:ProcN    1
  1242.  
  1243. Flush the “buffers”  of iounit. Especially useful when the io-unit is associated to a window (multiple writers).
  1244.  
  1245. (.i.load; string)    Closure:ProcN    1
  1246.  
  1247. Open the given file, read and evaluates all its content, then close the file.
  1248.  
  1249.  
  1250. 5.4.12 Erreurs et gestion d’.i.errors
  1251.  
  1252.  
  1253. (.i.printdebug; any)    Closure:ProcN    1
  1254.  
  1255. Prints, on the io-unit in stder, the external representation of the value of any  without forcing any of the suspensions in the object (then prints a Carriage return). A suspension is printed as a tuple made of the suspended code and the captured environment. Returns ?.
  1256.  
  1257. (printdebug (cons a b))    affichera  ({Susp: a in ()} | {Susp: b in ()})
  1258.  
  1259. (.i.error; error any)    Closure:ProcN    2
  1260.  
  1261. Raise error error  with message any. According to the current “error handling mode”, it will result in message printing, value return or debugger call.
  1262.  
  1263. (.i.error?; any)    Closure:ProcN    1
  1264.  
  1265. Returns † if the value ofany  is an “error” (Cf the closure type). Returns ƒ otherwise.
  1266.  
  1267. (error? 1)        fl    ƒ
  1268. (error? (1+ ‘a))    fl    †
  1269.  
  1270. (.i.explain; error)    Closure:ProcN    1
  1271.  
  1272. Returns the error message associated to error.
  1273.  
  1274. (explain ‘?:varundef)    fl "Variable non définie"
  1275.  
  1276.  
  1277. 5.4.13 .Control
  1278.  
  1279. Closures for .i.control; are few in Help. The introduction of escapes or explicit continuation (à la Scheme) brings few comfort in a non-parallel lazy frame. Nevertheless, the closure force allows to give to these facility all their original power, the primitive call/ep is used to express escapes (efficeint, but very limited use); the closure call/cc allows to capture the current continuation (à la Scheme).
  1280.  
  1281. (.i.call/ep; closure)    Closure:ProcN    1
  1282.  
  1283. Gives to the closure  (that should accept one argument) a closure of type ProcN, arity 1 that (when called) will allow to escape from the continuation and will give its argument value to tha call/ep continuation (as call/cc in Scheme). Nevertheless, this is only a “chronological continuation ” whose extent is limited6 (stack overwriting); therefore, it is useful only for “escapes” (catch/throw, tag/exit facilities).
  1284.  
  1285. (call/ep (lambda(k)(k 1) 2))    fl 1
  1286.  
  1287. (.i.call/cc; closure)    Closure:ProcN    1
  1288.  
  1289. Gives to the closure  (that should accept one argument) a closure of type ProcN, arity 1 that (when called) will allow to escape from the continuation and will give its argument value to tha call/ep continuation (as call/cc in Scheme). This continuation as unlimited extent but may need much memory and execution time (stacks are simply copied).
  1290.  
  1291. (call/cc (lambda(k)(k 1) 2))    fl 1
  1292.  
  1293. (.i.force; any)    Closure:ProcN    1
  1294.  
  1295. From a fonctionnal point of view, it is identity. However, it recursively forces all the suspensions in the value of any. It is essentially useful to simulate the transformation of Help suspensions in “futures” of a parallel machine and also to give back some dirty tricks (affectation, escapes…)  all their “functionnalities”…
  1296.  
  1297. (=! x 2)                fl 2
  1298. (=! x (force (cons 1 x)))        fl (1 | 2)    ;but not (1 1 1 1 1 1 1 1…)
  1299. (force
  1300.    (call/cc 
  1301.      (lambda(k)
  1302.        (cons 1 (k ‘Sortir)))))    fl Sortir    ;et non (1 | <teratos>)
  1303.  
  1304.  
  1305. (.i.if; any1 any2 …)    Closure:NProc    0
  1306.  
  1307. Because of Help lazyness, the conditionnal may be implemented as a closure in  Help. The closure if is the embodiement as a closure of the syntactic form cond (that is kept only for efficiency reasons !).
  1308.  
  1309. (if (eq? ‘a ‘b) 1
  1310.     (=? 1 2)    2
  1311.     3)                fl 3
  1312.  
  1313. (.i.eval; any environ)    Closure:ProcN    2
  1314.  
  1315. In the interpreted release of Help (if a realistic compiler may exist one day), this closure evaluate the form quelconque  in the environment environ.  In a compiled release, it should compile the form any  in the environment environ  and then execute the code compiled. One should note that if any  is already compiled (CODE type object) , the code is immediatly executed in the environment given. This allows an efficient EVAL execution if the forms have been precompiled (for multiple evaluation, exemple: constraints in a CSP like constraint solver).
  1316.  
  1317. (eval 1 ‘())                         fl 1
  1318. (eval (cons x x) ((lambda(x) (bindings)) ‘a))     fl (a | a)
  1319.  
  1320. (.i.or; any1…)    Closure:NProc    0
  1321.  
  1322. Evaluates the any1…  forms one after the other up to the point when one the value returned is not false or end of the  any1…  Returns the value of the last form evaluated.
  1323.  
  1324. (or (null? ‘a) (null? ‘()))         fl †
  1325. (or (number? ‘a) (number? 1.1))    fl 1.100000000000000e00
  1326.  
  1327. (.i.and; any1…)    Closure:NProc    0
  1328.  
  1329. Evaluates the any1…  forms one after the other up to the point when one the value returned is false or end of the  any1…  Returns the value of the last form evaluated.
  1330.  
  1331. (and (null? ‘a) (null? ‘()))     fl ƒ
  1332. (and (number? 10) (number? 1.1))    fl 1.100000000000000e00
  1333.  
  1334.  
  1335. 5.4.14 System
  1336.  
  1337. Here are all the closures that have some accointance with memory management, operating system…
  1338.  
  1339. (.i.type; any)    Closure:ProcN    1
  1340.  
  1341. Returns the type (contained in the “tag” of the referenced block) of any  value as a number (fix). The following table, or simple application of the closure type to an object gives the type interpretation:
  1342.  
  1343. integer fixed size    1    floating point number    2
  1344. bit-array    3    string    4
  1345. input/output unit    5    variable identifier (symbol)    6
  1346. constant identifier  (symbol)    7    error (symbol)    8
  1347. macro (symbol)    9    primitive key-word (symbol)    10
  1348. compiled or assembly code    11    closure    12
  1349. cons    13    vector    14
  1350. indirection7    15    environment    16
  1351. short environnement      17    bignum    19
  1352. memoïzable suspension8    20    non-memoïzable suspension9    21
  1353.  
  1354. (type ‘a)                fl 6
  1355. (type (+ 9999999999 1))        fl 19
  1356.  
  1357. (.i.coerce; any fixpos)    Closure:ProcN    2
  1358.  
  1359. Physically changes the type of any  in fixpos . Use type closure to get existing type. This function may foul the GC (Garbage COllector or “Glaneur de Cellules”), that will free unexisting or referencable  blocks leading to hard errors(Bus Error, Adress Error…). Harmless type conversion are possible between elements of the following group of types (note that coerce only changes the type of the object, not its content).
  1360.  
  1361. t    1 2 3 4 19     numbers et bit-arrays
  1362. t    6 7 8 9 10     identificateurs…
  1363. t    16 17 14     environnements et vectors
  1364.  
  1365. (.i.runtime;)    Closure:ProcN    0
  1366.  
  1367. Returns the time in 1/60 seconds since system boot.
  1368.  
  1369. (.i.chrono; any)    Closure:ProcN    1
  1370.  
  1371. Returns a three element vector. The first one is the value of any. The next one is the excution time (in seconds, ±1/60 second) to evaluate the form any  (Pay attention to lazyness, a print or a force may be useful to get a full evaluation) and the last one is the time used for Garbage Collection (Glanage de Cellules). Note that chrono automatically calls the compacifier GC BEFOREevaluating the form any  to get a significant “best” time (the time to make this GC is obviously not taken into account in the results given…). If the any form uses the GC via the closures compgc or masgc,  the result retourned will almost ignore the time taken for these GC.
  1372.  
  1373. (chrono (fib 20))     fl [10946 5.4000000000e+0 0.000000000000e+0]
  1374.  
  1375. (.i.masgc;)    Closure:ProcN    0
  1376.  
  1377. Calls the memory manager to execute a “Mark and Sweep” type GC. This GC is very efficient, but does not suppress memory fragmentation. Nevertheless it will suppress every  “indirection” blocks that could have been installed by forced closures or via the closure replace. Isolated garbage blocks with size 1 or 2 are not collected. Symbols whose value is undefined and which are not referencable ARE collected. The value returned is  ?.
  1378.  
  1379. (.i.compgc;)    Closure:ProcN    0
  1380.  
  1381. Calls the memory manager to execute a compacifying modified“Break Table” GC. This GC is slower, but suppresses fragmentation. It also collects all “indirection” type blocks (that could have been created via suspension forcing or replace closure). Symbols whose value is undefined and which are not referencable ARE collected. The value returned is  ?.
  1382.  
  1383. (.i.blength; any)    Closure:ProcN    1
  1384.  
  1385. Returns the memory used by any  in long words (32 bits). rhe memory used by the “tag” associated to every object (1 LW) is not taken into account.
  1386.  
  1387. (blength ‘a)        fl 6
  1388. (blength 2)        fl 1
  1389.  
  1390. (.i.bcopy; any)    Closure:ProcN    1
  1391.  
  1392. Returns a copy of the any . This is a simple surface copy (copy of the object itself, not of the objects referenced by it. It should not be employed on objects whose unicity is garanteed by the system (symbols…).
  1393.  
  1394. (bcopy 1)        fl 1
  1395. (eq? (bcopy x) x)    fl ƒ  ;(suppose value(x) ≠ symbol)
  1396. (=?  (bcopy x) x)    fl †    ;idem
  1397.  
  1398. (.i.replace; any1 any2)    Closure:ProcN    2
  1399.  
  1400. Replace physically every occurrence (in the sens of eq?)  of any1  by any2. This closure uses the indirections to operate. Use it with MUCH care on symbols (especially ƒ, †…). Its utility is yet to be determined, but is seems powerful…
  1401.  
  1402. (define x ‘(a b c))    fl (a b c)
  1403. (replace ‘b ‘k)    fl k
  1404. x            fl (a k c)
  1405.  
  1406. (.i.≈;)    Closure:ProcN    0
  1407.  
  1408. Obtenu au clavier par Option-X. Returns la dernière valeur obtenue au top-level.
  1409.  
  1410. (openi “palmipède”)    fl «IO-Unit»
  1411. (readio (≈))        fl (define (palmipede v)…)
  1412.  
  1413. (.i.where; any)    Closure:ProcN    1
  1414.  
  1415. Returns the memory address of any   in a fix size integer (32 bits).
  1416.  
  1417. (.i.find; any)    Closure:ProcN    1
  1418.  
  1419. Returns the list of every identifier whose value in the global environment is equal (in the sens of eq?) to the value of  any.  especially useful to find the symbol containing a closure or code…
  1420.  
  1421. (define x 1+)    fl {Closure: {Code 6800xx for 1+} in {Env: ()}}
  1422. (find x)    fl (x 1+)
  1423.  
  1424. 5.5 Help interface
  1425.  
  1426. We will describe the MacIntosh implementation. Note that:
  1427. • This implementation is usable only with 68020 or better microprocessors, a 68881 (or better) floating point unit is needed to use floating points (you may also use software emulation packages if you lack the 6888x). MMU is yet left unused.
  1428. • This implementation is not yet complete. The compiler is not really usable, the development environment is yet very poor (no printing, files limited to 32Ko…).
  1429.  
  1430. 5.5.1 .i.Configuration
  1431.  
  1432. The Help interpreter can run with very few memory  (less than 500 Ko) if you are ready to cope with many GC. One Mo is a nominal value. 4 Mo is really comfortable for most uses. Help runs under Multifinfer, but current release won’t really cope with System 7 (A bug probably coming from MPW  3.0 will bomb when QUITTING Help, therefore you may use Help under 7.0, but Quit = Reboot).
  1433.  
  1434. The .i.memory; “asked for” by Help is simply the memory size indicated in the “Get information”  (Command-I) under the Finder. One can change it easily. By default, this size is 512 Ko and should therfore be modified if possible.
  1435.  
  1436. To modify other features of Help, A set of resedit “TEMPLATES” ressources are given (insert these ressources in your Resedit copy) . They allow the user to simply modify Help interesting  .i.ressources; .
  1437.  
  1438. 5.5.1.1 The ressource CONF (Id 0, “Configuration”)
  1439.  
  1440. Contains four data, user modifiables:
  1441.  
  1442. t    Font Id: choose the default font of Help editor. The initial value (22) is for Courier (fixedwidth font, for better indent).
  1443. t    Font Size: Choose the default size for the font. Default: 9.
  1444. t    Block Visu: choose the duration (in 1/60 seconds) of lexical block visulisation (parenthesis match…) when using mouse click or cursor arrows. Initial value: 6 for 1/10 second.
  1445. t    Stack Memory %Age: choose how much memory you want to give to stacks. Initial value:10% (should be enough for almost any application).
  1446.  
  1447. 5.5.1.2 Ressources STC# 
  1448.  
  1449. They contain “C” strings. The first one(Id 0, “SynF Names”)  holds the name of every syntactic form of the language. These names may be modified to user convenience (You will have to modify every help source also…).
  1450.  
  1451. The next one  (Id 1, “Erreurs”) cholds alternatively the error message and the error name of every help error. Again, can go wild modifying error message (no side-effects) or error names (but pay attention to sources taht do refer to error names).
  1452.  
  1453. 5.5.1.3 Ressource STCL (Id 0, “Startup File”)
  1454.  
  1455. It simply contains the name of the startup file, loaded by Help when starting. (Initial value: Start”). It is possibel to use a full path (See closures openi et  openo).
  1456.  
  1457. 5.5.1.4  Ressource STCN (Id 0, “Closures Names”)
  1458.  
  1459. It contains informations related to predefined closures. Four fields for each closure:
  1460.  
  1461. t    Strictness: a number in hexa that should be interpreted as a 16 bit bit-array. The weak 15 bits gives strictness of the closure with respect to the first 15 args. The last one (the higher one)  gives the stricness for any supplementary argument.  It is therefore “easy” to suppress most lazyness from help by setting EVERY strictness to $FFFF and by using the macro defkap and kappa (instead of define and lambda, see Start file).
  1462.  
  1463. t    Arity: Gives the arity (or minimal arity) of the closure. User modification is neither required nor advised !
  1464.  
  1465. t    Type: Gives the type of the closure (fixed arity:0, variable arity: 1). User modification is neither required nor advised !
  1466.  
  1467. t    The string: Gives the name of the symbol that will denote the closure. If you modify this one, you will have to modify every sources that refer to this closure name ! (including Start file !).
  1468.  
  1469. 5.5.1.5 Ressource CART (Id 200, “Reader conf”)
  1470.  
  1471. Contains 256 bytes that give the reader the type of each ASCII codes. You may therefore modify the charcters for lists, vectors…  See § 5.2.8. You will again have to modify any source that may use these chars.
  1472.  
  1473. 5.5.1.6 Ressources WIND
  1474.  
  1475. To perfectly match your screen, the sizes and position of default Help windows are user-modifiable. You may set:
  1476.  
  1477. t    Size and position of the “Transcript” window, ID 1000;
  1478. t    Sizes and positions of the five edit windows, used cyclicly by Help at each window creation (ID 1001 to 1005).
  1479.  
  1480. 5.5.2 Using the editor
  1481.  
  1482. The editor intensively relies on ROM routines and inherit their limitations. The most important one being that no text should be longer than 32Ko. Undefined10 things may occur when this limit is reached
  1483.  
  1484. The “Transcript” window receives very error message (it is associated to the default error input/output unit denoted bythe symbol “stder”). It has every limitation of other windows (32 Ko limit) so think to clean it from time to time (Command-A, Backspace. Forgetting to clean it will simply lead to memory loss and weird printing… no bomb).
  1485.  
  1486. Every window is an edit and evaluate window. The scheme used rely on the validation key used (and is really great to use IMHO). Two different modes:
  1487.  
  1488. t    The carraige return key is for editing. It will simply change from one line to the following one, with automatic indentation and “(“, “[“ or “{“ matching.
  1489.  
  1490. t    The ENTER key(numerical keyboard) is for evaluation. If a sequence of chars has already been selected, this sequence will be evaluated. Otherwise, the previous S-expression will be automatically selected and evaluated (try it, you will understand immediatly).
  1491.  
  1492. In this case (ENTER key) it is possible to change the  READ-EVAL-PRINT behaviour:
  1493.  
  1494. t    If you press shift-ENTER instead of ENTER, no value will be printed. This is VERY useful in the frame of lazy evaluation (no suspension will be forced by the printer).
  1495.  
  1496. t    If you press Option-ENTER instead of enter, the value will be printed on the error input-output default unit (denoted by the symbol stder). This is especially useful to evaluate part of (or a whole) file without damaging it. Example: to load a file, select open, type command-A (select all) then Option-ENTER. Note that values are always printed between “comment chars” ({ and }).
  1497.  
  1498. The mouse “click” allows to easily check the “matching” of the “()”, “[]” and “{}”. If their is no match, you will hear a beep. Another useful trick: if you click with the Option key pressed, the matching is verified, shown and SELECTED. You will then be able to cut, paste… it. The double click selects a “word”.
  1499.  
  1500. 5.5.2 The valuator and the “bugs”…
  1501.  
  1502. Help has been used for much, much time, and very few bugs are known (in fact, only ONE, in bignum multiplication). In case of .i.bug; during evaluation (The mouse pointer will look like a small Macintosh) or during a GC (Mouse pointer in Sweep, mark, or Compacify 1,2 or 3 state):
  1503.  
  1504. t    If you use a debugger, simply GO to the address contained in the D6 register (type “G D6” under MacsBug). You will return to toplevel in the best possible conditions (stacks and main Help machine registers set to default values). Nevertheless, the system may be unstable, especially if Help or macintosh heap are damaged. You are advised to save and exit (or reboot).
  1505.  
  1506. t    Otherwise, The “System Error Manager” will try to draw a simple dialog with an error message and two buttons. If the Mac Heap is damaged…This drawing may be partial. Simply rememberthat LEFT button is “Reboot” and RIGHT is “Resume” (it will resume Help as if you had a debugger and had typed “G D6” (If the screen appearance has been damaged by the dialog, simply zoom and unzoom one of Help windows). Nevertheless, the system may be unstable, especially if Help or macintosh heap are damaged. You are advised to save and exit (or reboot).
  1507.  
  1508.  
  1509. Bibliography
  1510.  
  1511. [Abelson 85] :     Harold Abelson et Gerald Jay Sussman avec Julie Sussman
  1512.     Structure and Interpretation of Computer Programs
  1513.     M.I.T. Press, Cambridge, 1985
  1514. [Aho 83]:    A. Aho, J. Hopcroft et  J. Ullmann
  1515.     Structures de données et Algorithmes
  1516.     InterEditions 87 (orig.  Addison & Wesley 83)
  1517. [Aho 86]:    A. Aho, R. Sethi et  J. Ullmann
  1518.     Compilateurs: Principes, Techniques et Outils
  1519.     InterEditions 89 (orig.  Addison & Wesley 86)
  1520. [Allen 78]:    John Allen
  1521.     Anatomy of LISP
  1522.     McGraw-Hill Inc., 1978
  1523. [Allison 86]:    Lloyd Allison
  1524.     A Practical introduction to denotational semantics
  1525.     Cambridge University Press, 1986
  1526. [Ashcroft 85]:    Edward A. Ashcroft, William W. Wadge
  1527.     Lucid, the Dataflow Programming Language
  1528.     Academic Press, 1985
  1529. [Avenhaus 90]    J. Avenhaus & K. Madlener
  1530.     Term Rewriting and Equationnal Reasoning
  1531.     Elsevier Science Publishers - North Holland, 1990
  1532. [Barendregt 84]    Barendregt H.P.
  1533.     The Lambda calculus, Its syntax and semantics
  1534.     North Holland, 1984
  1535. [Bloss 88]    A. Bloss, P. Hudak, J. Young
  1536.     Code Optimisations for Lazy  Evaluation
  1537.     Lisp ans Symbolic Computation ,Vol. 1, N° 2,p 147-164 (1988)
  1538. [Briot 86]    J.P. Briot, P. Cointe & E. Saint-James
  1539.     Réécriture et récursion dans a closure
  1540.     Journées Langages Orientés Objet - p90-100
  1541. [Cayrol 85] :    Cayrol Michel
  1542.     Conception, Formalisation et Expérimentation d’un modèle pour le 
  1543.     traitement d’objets finis ou infinis dénombrables.
  1544.     Thèse d’Etat , Université Paul Sabatier, 1985
  1545. [Cayrol 87] :     Schiex Thomas,  Cayrol Michel
  1546.     Psil: L’infini en programmation
  1547.     AFCET-RFIA 1987
  1548. [Cayrol 92]    Cayrol Michel, Palmade Olivier, Schiex Thomas
  1549.     A fixed point Semantics for the ATMS.
  1550.     Journal of Logic and Computation (to appear), 1992
  1551. [Chailloux 80]:    Jérôme Chailloux
  1552.     Le Modèle VLisp: Description,  Implémentation et Evaluation
  1553.     Thèse de troisième cycle, Université P. et M. Curie (Paris VI), 1980
  1554. [Chailloux ??]:    Jérôme Chailloux & ??
  1555.     Manuel Le_Lisp version 15.21 
  1556.     INRIA - 19??
  1557. [Clinger 82]:    William Clinger
  1558.     NonDeterministic Call by Need is Neither Lazy Nor by Name
  1559.     ACM Symposium on Lisp and Functionnal Programming, 1982
  1560. [Clinger 87]:    William Clinger, Jonathan Rees (Editors)
  1561.     Revised3 Report on the Algorithmic Language Scheme
  1562.     M.I.T. Artificial Intelligence Memo. 
  1563. [CM2 87]:    Thinking Machines Company
  1564.     Connection Machine - Model CM-2 - Technical Summary
  1565.     Thinking Machines technical report HA87-4 , 1987
  1566. [Cohen 83]:    Comparison of Compacting Algorithms for Garbage Collection
  1567.     Jacques Cohen & Alexandru Nicolau
  1568.     ACM Transactions on Prgramming Languages and Systems Vol5, N°4, 
  1569.     Octobre 1983 - p532-553
  1570. [Cousineau 89]:    Guy Cousineau et Gérard Huet
  1571.     The CAML Primer - Projet Formel
  1572.     INRIA-ENS- 1989
  1573. [Dybvig 90]:    R. Kent Dybvig & Robert Hieb
  1574.     A New Approach to Procedures with Variable Arity
  1575.     Lisp & Symbolic computation, Vol.3, N°3, p229-244 (1990)
  1576. [Field 88]:    Anthony J. Field, Peter G. Harisson
  1577.     Functionnal Programming
  1578.     Addison Wesley Publishing company - 1988
  1579. [Gabriel 85]:    Richard P. Gabriel
  1580.     Performance and Evaluation of Lisp Systems
  1581.     The MIT Press - 1985
  1582. [Girardot  85]:    Jean Jacques Girardot
  1583.     Les langages et  les systèmes LISP
  1584.     EdiTests, 1985
  1585. [Halstead  85]:    Halstead R.H.
  1586.     MultiLisp: A Language for concurrent symbolic computation.
  1587.     ACM Transactions on Prgramming languages and systems 7(4),
  1588.     (p 501-538) (Octobre 1985).
  1589. [Hillis  ??]:    Hillis ??
  1590.     The Connection machine 
  1591.  
  1592. [Hindley 86]:    J. Roger Hindley & Jonathan P. Seldin
  1593.     Introduction to Combinators and l-Calculus
  1594.     Cambridge University Press, 1986
  1595.     Addison Wesley Publishing Company, 1968
  1596. [Jaulent 87]:    P. Jaulent & L. Baticle
  1597.     µ-processeurs 68020, 68030 et leurs coprocesseurs.
  1598.     Eyrolles (1987)
  1599. [Knuth 68]:    Donald E. Knuth
  1600.     The Art of Computer Programming. Vol.1. Fundamental Algorithms
  1601.     Addison Wesley Publishing Company, 1968
  1602. [Mac 85-86]:    Apple Computer Inc.
  1603.     Inside MacIntosh, Vol I à V
  1604.     Addison Wesley Publishing Company, 1985-86
  1605. [Schiex 87] :     Schiex Thomas
  1606.     Psil: Manipulation d’objets infinis dénombrables
  1607.     Rapport de D.E.A., Université Paul Sabatier, 1987
  1608. [Schiex 88]    Schiex Thomas
  1609.     Psil et la Connection Machine
  1610.     Rapport pour le C.N.R.S et le Conseil Régional (1988)
  1611. [Schiex 89] :     Schiex Thomas
  1612.     Psil: A héritier de Scheme
  1613.     BIGRE: Special Issue : “Putting Scheme to work” , 1989
  1614. [Schiex 91]    Schiex Thomas
  1615.     Interprétation et Compilation d'un dialecte paresseux de Scheme: Help
  1616.     Phd. Thesis
  1617.     Université Paul Sabatier, Toulouse, France
  1618. [Steele 90]    Guy L. Steele Jr.
  1619.     Common Lisp: the language (2nd edition)
  1620.     Digital Press - 1990
  1621. [Tarski 55]    Tarski A.
  1622.     A Lattice-theorical FixPoint Theorem and its Applications
  1623.     Pacific J. Math. (p285-309), 1955
  1624.  
  1625. Examples
  1626.  
  1627. {Function composition}
  1628. {••••••••••••••••••••}
  1629. (define (rond f g) 
  1630.         (lambda x (f (apply g x))))
  1631.  
  1632. {integers}
  1633. {••••••••}
  1634. (define n (… 0))
  1635.  
  1636. {all the fibonacci’s}
  1637. {•••••••••••••••••••}
  1638. (define (fibn n1 n2) (cons n1 (fibn (+ n1 n2) n1)))
  1639. (define fibl (cons 1 (cons 1 (map (∞ +) fibl (-1 fibl)))))
  1640.  
  1641. {A strange suite defined by a fixpoint}
  1642. {•••••••••••••••••••••••••••••••••••••}
  1643. (define (entrelace l1 l2)
  1644.       (cons (0 l1) (cons (0 l2) (entrelace (-1 l1) (-1 l2)))))
  1645. (define biz (entrelace (… 0) biz))
  1646.  
  1647. {readin flow}
  1648. {•••••••••••}
  1649. (define (in)(cons (read)(in)))
  1650. (define input (in))
  1651.  
  1652. {Factorielle CPS…}
  1653. {••••••••••••••••}
  1654. (define (fact x k)
  1655.      (cond (zero? x)(k 1)
  1656.      (fact (- x 1)(lambda(n)(k (* x n))))))
  1657. (define factl (cons 1 (map (∞ *) (… 1) factl)))
  1658.  
  1659. {Eratosthene crible}
  1660. {••••••••••••••••••}
  1661. (define (erat l)
  1662.      (cons (0 l)
  1663.            (erat (diff (-1 l)
  1664.                        (map (∞ *) (∞ (0 l)) l)))))
  1665.  
  1666. {Decomposition in prime numbers}
  1667. {••••••••••••••••••••••••••••••}
  1668. (define (dec n l)    ; l should be the prime numbers list
  1669.   (cond (=? n 1) ()
  1670.         (zero? (modulo n (0 l))) (cons (0 l) (dec (/ n (0 l)) l))
  1671.         (< n (* (0 l)(0 l))) (list n)
  1672.         (dec n (-1 l))))
  1673.  
  1674. {Church numerals}
  1675. {•••••••••••••••}
  1676. (define plus 
  1677.   (lambda(n1)
  1678.          (lambda(n2)
  1679.                 (lambda(f)
  1680.                        (lambda(x)
  1681.                               ((n1 f) ((n2 f) x)))))))
  1682.  
  1683. (define zero (lambda(f) (lambda(x) x)))
  1684.  
  1685. (define mul
  1686.   (lambda(n1)
  1687.          (lambda(n2)
  1688.                 (lambda(f)
  1689.                        (lambda(x)
  1690.                               ((n1 (n2 f)) x))))))
  1691. (define suc 
  1692.   (lambda(n)
  1693.          (lambda(f)
  1694.                 (lambda(x) ((n f)(f x))))))
  1695.  
  1696. (define a (suc zero))
  1697. (define deux (suc a))
  1698. (define trois (suc deux))
  1699. (define quatre ((mul deux)deux))
  1700.  
  1701. (define exp
  1702.   (lambda(n1)
  1703.          (lambda(n2)
  1704.                 (lambda(f)
  1705.                        (lambda(x)
  1706.                               (((n2 n1) f) x))))))
  1707.  
  1708. {The paradoxical combinators}
  1709. {•••••••••••••••••••••••••••}
  1710.  
  1711. ;by Church Y0
  1712. (define (Y0 g)
  1713.   ((lambda(x) (G (x x)))(lambda(x)(G (x x)))))
  1714.  
  1715. {The fixed point for fixed point combinator}
  1716. (define (G y)
  1717.   (lambda(f) (f (y f))))
  1718.  
  1719. ;by Turing Y1=Y0 G
  1720. (define Y1 
  1721.   ((lambda(a)
  1722.     (lambda(b) (b ((a a) b)))) (lambda(a)
  1723.                                  (lambda(b) (b ((a a) b))))))
  1724. ;another WEIRD fpc by Klop
  1725. (define £
  1726.  (lambda(a)
  1727.   (lambda(b)
  1728.    (lambda(c)
  1729.     (lambda(d)
  1730.      (lambda(e)
  1731.       (lambda(f)
  1732.        (lambda(g)
  1733.         (lambda(h)
  1734.          (lambda(i)
  1735.           (lambda(j)
  1736.            (lambda(k)
  1737.             (lambda(l)
  1738.              (lambda(m)
  1739.               (lambda(n)
  1740.                (lambda(o)
  1741.                 (lambda(p)
  1742.                  (lambda(q)
  1743.                   (lambda(s)
  1744.                    (lambda(t)
  1745.                     (lambda(u)
  1746.                      (lambda(v)
  1747.                       (lambda(w)
  1748.                        (lambda(x)
  1749.                         (lambda(y)
  1750.                          (lambda(z)
  1751.                           (lambda(r)
  1752. (r (((((((((((((((((((((((((
  1753.              (t h)i)s)i)s)a)f)i)x)e)d)p)o)i)n)t)c)o)m)b)i)n)a)t)o)r)
  1754.                            ))))))))))))))))))))))))))))
  1755.  
  1756. (define $ ((((((((((((((((((((((((
  1757.           (£ £)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)£)
  1758.  
  1759. ;another one, "à la Klop" in a French release
  1760. (define £
  1761.  (lambda(a)
  1762.   (lambda(b)
  1763.    (lambda(c)
  1764.     (lambda(e)
  1765.      (lambda(f)
  1766.       (lambda(g)
  1767.        (lambda(h)
  1768.         (lambda(i)
  1769.          (lambda(j)
  1770.           (lambda(k)
  1771.            (lambda(l)
  1772.             (lambda(m)
  1773.              (lambda(n)
  1774.               (lambda(o)
  1775.                (lambda(p)
  1776.                 (lambda(q)
  1777.                  (lambda(r)
  1778.                   (lambda(s)
  1779.                    (lambda(t)
  1780.                     (lambda(u)
  1781.                      (lambda(v)
  1782.                       (lambda(w)
  1783.                        (lambda(x)
  1784.                         (lambda(y)
  1785.                          (lambda(z)
  1786.                           (lambda(d)
  1787. (d (((((((((((((((((((((((((
  1788.               (H e)l)p)E)s)t)T)e)r)r)i)b)l)e)m)e)n)t)F)l)e)m)m)a)r)d)
  1789.                             ))))))))))))))))))))))))))))
  1790.  
  1791. ;factorial funtionnal, to use with Y combinators
  1792. (define (FF f)
  1793.   (lambda(x)
  1794.     (cond (zero? x) 1
  1795.           (* (f (1- x)) x))))
  1796.  
  1797. {computation with unknowns: replace the leafs of a tree by the maximum leaf}
  1798. {••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••}
  1799. (define (rpm l)
  1800.   (letrec [((f n rest&maxc)
  1801.                (cons (cons max (0 rest&maxc))
  1802.                      (cond (>? n (-1 rest&maxc)) n (-1 rest&maxc))))
  1803.            (rest (reduce f '(() | 0) l))
  1804.            (max (-1 rest))]
  1805.           (0 rest)))
  1806.  
  1807.  
  1808. Index
  1809.  
  1810.  
  1811. *, 20
  1812. +, 20
  1813. -, 20
  1814. /, 21
  1815. 1+, 20
  1816. 1-, 20
  1817. <>?, 17
  1818. <?, 21
  1819. =!, 12
  1820. =?, 17
  1821. >?, 21
  1822. acos, 22
  1823. and, 30
  1824. append, 19
  1825. apply, 23
  1826. asin, 22
  1827. atan, 22
  1828. atanh, 22
  1829. atom?, 18
  1830. bcopy, 32
  1831. begin, 14
  1832. binding=!, 25
  1833. binding=?, 25
  1834. bindings, 13
  1835. bit-arrays, 8
  1836. bitand!, 26
  1837. bitarray?, 25
  1838. bitchg!, 27
  1839. bitclr!, 26
  1840. bitcount, 26
  1841. bitfind, 26
  1842. bitnot!, 26
  1843. bitor!, 26
  1844. bitset!, 26
  1845. bitxor!, 26
  1846. blength, 32
  1847. boolean?, 16
  1848. booleans, 16
  1849. bug, 35
  1850. call/cc, 29
  1851. call/ep, 29
  1852. car=!, 18
  1853. cdr=!, 18
  1854. cell, 24
  1855. cell=!, 24
  1856. cell?, 24
  1857. cells, 7
  1858. chrono, 31
  1859. close, 28
  1860. closures, 16
  1861. coerce, 31
  1862. compgc, 32
  1863. cond, 12
  1864. Configuration, 33
  1865. cons, 18
  1866. cons?, 18
  1867. conses, 17
  1868. constants, 9
  1869. control, 29
  1870. cos, 21
  1871. cosh, 22
  1872. Debugging, 14
  1873. defext, 13
  1874. define, 10
  1875. defmacro, 13
  1876. envar, 25
  1877. environment?, 24
  1878. environnement, 24
  1879. eq?, 16
  1880. equal?, 17
  1881. equivalence predicates, 16
  1882. error, 28
  1883. error handling, 14
  1884. error?, 29
  1885. errors, 9, 28
  1886. eval, 30
  1887. exp, 22
  1888. expand, 23
  1889. explain, 29
  1890. find, 32
  1891. float, 21
  1892. floatings, 7
  1893. flushio, 28
  1894. force, 29
  1895. getcode, 23
  1896. getenv, 23
  1897. getstrict, 23
  1898. ibase, 22
  1899. if, 30
  1900. input/output, 27
  1901. integers, 6
  1902. intern, 20
  1903. keywords, 9
  1904. lambda, 11
  1905. length, 19
  1906. let, 14
  1907. letrec, 14
  1908. list, 19
  1909. list?, 18
  1910. lists, 7, 17
  1911. load, 28
  1912. log, 22
  1913. makebitarray, 25
  1914. makecell, 24
  1915. makeenv, 25
  1916. masgc, 31
  1917. memory, 33
  1918. modulo, 21
  1919. neq?, 16
  1920. nequal?, 17
  1921. nomemo, 12
  1922. not, 16
  1923. null?, 18
  1924. numbers, 20
  1925. openi, 28
  1926. openo, 28
  1927. or, 30
  1928. pause, 14
  1929. primitive expressions, 10
  1930. prin, 27
  1931. prindepth, 27
  1932. prinio, 28
  1933. prinlength, 27
  1934. print, 27
  1935. printdebug, 28
  1936. quote, 11
  1937. read, 27
  1938. readio, 28
  1939. replace, 32
  1940. ressources, 33
  1941. runtime, 31
  1942. Semantics, 4
  1943. setstrict, 23
  1944. sin, 21
  1945. sinh, 22
  1946. special characters, 10
  1947. sqrt, 22
  1948. stder, 27
  1949. stdi, 27
  1950. stdo, 27
  1951. step, 15
  1952. strings, 8
  1953. symbol?, 19
  1954. Symbols, 8, 19
  1955. tan, 22
  1956. tanh, 22
  1957. type, 30
  1958. vectors, 23
  1959. warn, 15
  1960. where, 32
  1961. zero?, 21, 27
  1962. ∞, 19
  1963. ≈, 32
  1964. …, 19
  1965. 1 Du moins, c’est la cas dans le cadre d’une utilisation normale. Il est possible d’élargir la portée d’une variable (Cf  § 3.5.1.1FR).
  1966. 2 Les premiers évaluateurs Lisp utilisaient une syntaxe différente, distinguant programmes et données (M Expressions opposées aux S Expressions actuelles).
  1967. 3 NaN= Not a Number. Retourné lors de la lecture d’une séquence de caractères ne formant pas un nombre flottant.
  1968. 4 structure de données comportant deux champs non typés appelés (pour des raisons historiques) CAR et CDR  (prononcé  “coudair).
  1969. 5  in the sens of eq?, there is no “hash-consing”.
  1970. 6 c’est le seul objet Help ayant une durée de vie limitée.
  1971. 7 type invisible pour l’utilisateur.
  1972. 8 type invisible pour l’utilisateur.
  1973. 9 type invisible pour l’utilisateur.
  1974. 10 Wthout any danger, i.e. you should be able to save anyway, then split the file using a decent text editor.
  1975.  
  1976.